package com.feibiao.computer;

import java.util.Scanner;

public class Involution implements Compute {
	private double result;
    @Override
    public double compute() {
        double operand1,operand2;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入底数");
        operand1 = scanner.nextDouble();
        System.out.println("请输入指数");
        operand2 = scanner.nextDouble();
        if ((int)operand2 != 0){
            result = operand1;
            for (int i = 1;i < (int)operand2;i++){
                result *= operand1;
            }
        }else if((int)operand2 == 0){
            result = 1;
        }
        return result;
    }
}
